package com.example.cafe.work.config;

import com.example.cafe.work.dto.ResResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@Slf4j
@RestControllerAdvice
public class ExceptionController {
    @ExceptionHandler(RuntimeException.class)
    public ResResult handlerException(Exception e){
        log.error(e.toString(),e);
        return ResResult.error("服务器异常");
    }
}
